package com.anyou.mall.parts.service.impl;

import java.util.List;
import com.anyou.common.utils.DateUtils;
import com.anyou.mall.parts.domain.PlaPartsClassifyParam;
import com.anyou.mall.parts.mapper.PlaPartsClassifyParamMapper;
import com.anyou.mall.parts.service.IPlaPartsClassifyParamService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 配件分类参数Service业务层处理
 *
 * @author ylj
 * @date 2022-03-10
 */
@Service
public class PlaPartsClassifyParamServiceImpl extends ServiceImpl<PlaPartsClassifyParamMapper, PlaPartsClassifyParam> implements IPlaPartsClassifyParamService
{
    @Autowired
    private PlaPartsClassifyParamMapper plaPartsClassifyParamMapper;

    /**
     * 查询配件分类参数
     *
     * @param partsClassifyParamId 配件分类参数主键
     * @return 配件分类参数
     */
    @Override
    public PlaPartsClassifyParam selectPlaPartsClassifyParamByPartsClassifyParamId(Long partsClassifyParamId)
    {
        return plaPartsClassifyParamMapper.selectPlaPartsClassifyParamByPartsClassifyParamId(partsClassifyParamId);
    }

    /**
     * 查询配件分类参数列表
     *
     * @param plaPartsClassifyParam 配件分类参数
     * @return 配件分类参数
     */
    @Override
    public List<PlaPartsClassifyParam> selectPlaPartsClassifyParamList(PlaPartsClassifyParam plaPartsClassifyParam)
    {
        return plaPartsClassifyParamMapper.selectPlaPartsClassifyParamList(plaPartsClassifyParam);
    }

    /**
     * 新增配件分类参数
     *
     * @param plaPartsClassifyParam 配件分类参数
     * @return 结果
     */
    @Override
    public int insertPlaPartsClassifyParam(PlaPartsClassifyParam plaPartsClassifyParam)
    {
        plaPartsClassifyParam.setCreateTime(DateUtils.getNowDate());
        return plaPartsClassifyParamMapper.insertPlaPartsClassifyParam(plaPartsClassifyParam);
    }

    /**
     * 修改配件分类参数
     *
     * @param plaPartsClassifyParam 配件分类参数
     * @return 结果
     */
    @Override
    public int updatePlaPartsClassifyParam(PlaPartsClassifyParam plaPartsClassifyParam)
    {
        plaPartsClassifyParam.setUpdateTime(DateUtils.getNowDate());
        return plaPartsClassifyParamMapper.updatePlaPartsClassifyParam(plaPartsClassifyParam);
    }

    /**
     * 批量删除配件分类参数
     *
     * @param partsClassifyParamIds 需要删除的配件分类参数主键
     * @return 结果
     */
    @Override
    public int deletePlaPartsClassifyParamByPartsClassifyParamIds(Long[] partsClassifyParamIds)
    {
        return plaPartsClassifyParamMapper.deletePlaPartsClassifyParamByPartsClassifyParamIds(partsClassifyParamIds);
    }

    /**
     * 删除配件分类参数信息
     *
     * @param partsClassifyParamId 配件分类参数主键
     * @return 结果
     */
    @Override
    public int deletePlaPartsClassifyParamByPartsClassifyParamId(Long partsClassifyParamId)
    {
        return plaPartsClassifyParamMapper.deletePlaPartsClassifyParamByPartsClassifyParamId(partsClassifyParamId);
    }
}
